<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">

      <a:outputPanel id="messagePanel">
           <rich:messages styleClass="message"/>
    </a:outputPanel>

    <a:form id="departmanEkleForm" enctype="multipart/form-data" ajaxSubmit="true">
           
   
    
     <a:outputPanel id="departmanKayitPanel">
        <rich:panel>
        
             <f:facet name="header">#{messages['departman.title.kayit']}</f:facet>
        
          <h:panelGrid columns="1">
        
            <s:decorate  template="/layout/edit.xhtml">
                <ui:define name="label">#{messages['departman.ad']}</ui:define>
                <h:inputText id="departmanAdi" required="true" 
                             value="#{departmanDao.departman.departmanAdi}" requiredMessage="#{messages['kisiler.zorunlu']}"/>              
            </s:decorate>
            
            
            <s:decorate template="/layout/edit.xhtml">
                <ui:define name="label">#{messages['departman.sorumlusu']}</ui:define>
                <h:inputText id="departmanSorumlusu" required="true" 
                             value="#{departmanDao.departman.departmanSorumlusu}" requiredMessage="#{messages['kisiler.zorunlu']}"/>                     
            </s:decorate>
            
            
            <s:decorate template="/layout/edit.xhtml">
                <ui:define name="label">#{messages['departman.dahiliTel']}</ui:define>              
                <h:inputText id="dahili" required="true" 
                             value="#{departmanDao.departman.dahiliTel}" requiredMessage="#{messages['kisiler.zorunlu']}" maxlength="11">
                   <rich:beanValidator/>
                </h:inputText>                                                                 
            </s:decorate>
            
            
            <s:decorate template="/layout/edit.xhtml" id="resimId">
                <ui:define name="label">#{messages['departman.resim']}</ui:define>              
                
            <rich:fileUpload fileUploadListener="#{departmanDao.listener}"
                maxFilesQuantity="5"  listHeight="65px" listWidth="300px" 
                id="upload"  
                immediateUpload="false"
                acceptedTypes="jpg, gif, png, bmp" allowFlash="false"  
                
                addControlLabel="Ekle" stopControlLabel="Durdur" doneLabel="Yuklendi" 
                
                clearControlLabel="Temizle" clearAllControlLabel="Temizle" uploadControlLabel="Yukle" />
                                                                                    
            </s:decorate>
            
            
           </h:panelGrid>
            

            <div style="clear:both"/>

        </rich:panel>
      </a:outputPanel>


        <div class="actionButtons">
           
           <a:commandButton value="Kaydet" action="#{departmanDao.departmanEkle()}" ajaxSingle="true" 
           
           process="departmanAdi,departmanSorumlusu,dahili,upload" reRender="messagePanel,departmanKayitPanel"/> 
        
           <a:commandButton value="Listele" action="#{departmanDao.departmansList()}"  ajaxSingle="true" reRender="departmanReturnValue"/> 
           <a:commandButton value="Temizle" action="#{departmanDao.temizle()}"  ajaxSingle="true" reRender="departmanReturnValue,departmanKayitPanel" />           
           <a:commandButton value="Ara" action="#{departmanDao.geri()}" ajaxSingle="true"/> 
             
        </div>
      
   </a:form>
        <ui:include src="/departmanList.xhtml"/>
    
       
       <a:status onstart="#{rich:component('wait')}.show()"
			onstop="#{rich:component('wait')}.hide()" />
		<rich:modalPanel id="wait" autosized="true" width="200" height="120"
			moveable="false" resizeable="false">
			<f:facet name="header">
				<h:outputText value="#{messages['listesi.islemYapiliyor']}"/>
			</f:facet>
			<h:outputText value="#{messages['listesi.lutfenBekleyiniz']}"/>
		</rich:modalPanel>

    
    
    
    	
  
    
    
    
    

</ui:define>
       
</ui:composition>
